package com.example.demo.jvm;
/**
* @description: TODO
* @author 杨镇宇
* @date 2022/3/10 18:43
* @version 1.0
*/

public class JvmTest1 {
    static     Integer count = 0;
    public   static synchronized void add(){
        count ++;
    }
    public static void main(String[] args) {
        for (int i=0;i<1000;i++){
            new Thread(new Runnable() {
                @Override
                public void run() {
//                    synchronized (count){
//                        count++;
//                    }
                    add();
                }
            }).start();
        }
            System.out.println("".length());
            System.out.println(JvmTest1.count);



    }
}
